﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class admin_WZinfo : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (null == Session["admin"])
        {
            Response.Write("<script>alert('请登录！');window.location.href='SysLogin.aspx';</script>");
            SqlDataSource2.SelectCommand = "select * from qinglink";
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
       
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        string wname=TextBox1.Text;
        string wangzhi=TextBox2.Text;
        string sql = "insert into qinglink values('" + wname + "','"+wangzhi+"')";
        jzweb jz = new jzweb();
        int i = Convert.ToInt32(jz.addJz(sql));
        if (i == 1)
        {
            SqlDataSource2.SelectCommand = "select * from qinglink";
            TextBox1.Text = "";
            TextBox2.Text = "";
        }
        else
        {
            Label1.Text = "<script>alert('失败！');</script>";
        }
    }
}
